//
//  ScannerView.h
//  NongWanCloud
//
//  Created by YueWen on 2018/3/20.
//  Copyright © 2018年 YueWen. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>

NS_ASSUME_NONNULL_BEGIN

@class RITLScannerView;
@protocol RITLScannerDelegate <NSObject>

@optional

- (void)scannerView:(RITLScannerView *)scannerView data:(AVMetadataObject *)object;

@end

/// 二维码扫描的视图
@interface RITLScannerView : UIView

/// 代理对象
@property (nonatomic, weak, nullable) id<RITLScannerDelegate>delegate;
/// 掌管画面的session
@property (nonatomic, strong, readonly)AVCaptureSession *captureSession;
/// 扫描的四周边距，默认为(166,52,*,52)
@property (nonatomic, assign)UIEdgeInsets scannerInset;
/// 指示器,出现画面前进行转动
@property (nonatomic, strong) UIActivityIndicatorView * indicatorView;
/// 扫描的框
@property (nonatomic, strong, readonly) UIImageView * boxImageView;

- (void)start;
- (void)stop;

@end

NS_ASSUME_NONNULL_END
